Add global asset_count to ApplicationStats and surface in home page StatsBar#2754
Closed
Add global asset_count to ApplicationStats and surface in home page StatsBar#2754
Conversation
Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com> Agent-Logs-Url: https://github.com/dandi/dandi-archive/sessions/000dd05b-4d3e-4588-94aa-be37b35c82bb
Copilot
AI
changed the title
[WIP] Explore better placement for file size and file count
Add global asset_count to ApplicationStats and surface in home page StatsBar
Mar 25, 2026
Member
Member
|
yeap, copilot ended up being useless for this one. Sorry for the noise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The global stats endpoint and home page lacked a total file count — only per-dandiset asset counts existed. This adds
asset_countas a first-class field inApplicationStats, computed alongside the existingsizemetric and exposed on the home page.Backend
asset_count = PositiveBigIntegerField(default=0)toApplicationStatsAsset.total_count()classmethod (mirrorstotal_size()pattern) — counts distinct assets belonging to at least one versioncompute_application_statstask to populate it0031adds the field and backfills existing rows/api/stats/now returns:{ "dandiset_count": …, "published_dandiset_count": …, "user_count": …, "size": …, "asset_count": … }Frontend
StatsBar.vueadds files as a 4th global stat (dandisets / files / users / total size)md=4tomd=3to fit 4 stats per rowTests
test_stats_baselineupdated to expectasset_count: 0test_stats_asset_countverifies multiple assets are counted correctlytest_stats_assetextended to assertasset_count == 1Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.launchpad.net/usr/bin/add-apt-repository add-apt-repository ppa:deadsnakes/ppa -y(dns block)astral.sh/usr/bin/curl curl -LsSf REDACTED git conf�� it --global nfig/composer/ve/var/lib/dpkg/info/libxi6:amd64.list credential.usernid(dns block)releases.astral.sh/home/REDACTED/.local/bin/uv uv python install 3.13 --force-confold --print-foreign-architectures --global ount-positions committer.name(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.